package com.boang.entity;

import java.util.Scanner;

/*
    @author:sa
    @date:2024/11/19 9:28
*/
public class Bank {
   public Account[]accounts=new Account[2];

    public Bank(){
//        sa[0]=new SavingAccount("a","a",3000);
//        ca[0]=new CreditAccount("b","b",1000);
        accounts[0]=new SavingAccount("a","a",3000);
        accounts[1]=new SavingAccount("b","b",1000);
    }
    public Account verify(String cardNo,String pass) {
        for (int i = 0; i < accounts.length; i++) {
            Account account = accounts[i];
            if (account.carNo.equals(cardNo) && account.passwd.equals(pass)) {
                return account;
            }
        }
        return null;
    }
//    public void mation(){
//
//        System.out.println();
//    }
public void saveMoney(int money,Account account){
        account.save(money);
}
public void depositMoney(int money,Account account){
        account.deposit(money);
}

}
